<!--suppress ALL -->
<include file="./Template/header.html" />

<link rel="stylesheet" type="text/css" href="/Template/css/exam.css?v=1">
<script type="text/javascript" src="/Template/js/amazeui.js"></script>
<script type="text/javascript">


    $(function() {

        //初始化页面配置
        initPage("检测评估");

//        $("#pronationCheck input[type='checkbox']").click(function() {
//            lert(113);
//            if($(this).is(":checked")){
//                alert(123);
//            }
//        });
        $("textarea").keypress(function(e) {
            if (e.which == 13) {
                return false;
            }
        });


        var app = new Vue({
            el: '#container',
            data: {
            },
            methods: {
                checkRole: function(employeeRoleId, roleId) {
                    var employeeRoleArr = employeeRoleId.split(",");
                    var roleArr = roleId.split(",");

                    var result = false;
                    $.each(roleArr, function(i,val){
                        if($.inArray(val, employeeRoleArr) != -1 || $.inArray((parseInt(val)+100).toString(), employeeRoleArr) != -1){
                            result = true;
                        }
                    });
                    return result;
                },
                cancel: function() {
                    window.location.href = "/wechat/workorder/index/id/{$workorderId}";
                },
                save: function() {
                    var examBasicId = $("input[name=examBasicId]").val();
                    var workorderId = $("input[name=workorderId]").val();
                    var side  = $("select[name=side]").val();
                    var eb0 = $("select[name=eb0]").val();
                    var eb1 = $("input[name=eb1]").val();
                    var eb2 = $("select[name=eb2]").val();
                    var eb3 = $("select[name=eb3]").val();
                    var eb4 = $("input[name=eb4]").val();
                    var eb5 = $("select[name=eb5]").val();
                    var eb6 = $("input[name=eb6]").val();
                    var eb7 = $("select[name=eb7]").val();
                    var eb8 = $("select[name=eb8]").val();
                    var eb9 = $("input[name=eb9]").val();
                    var eb10 = $("select[name=eb10]").val();
                    var eb11 = $("input[name=eb11]").val();
                    var eb12 = $("input[name=eb12]").val();
                    var eb13 = $("input[name=eb13]").val();
                    var eb14 = $("select[name=eb14]").val();
                    var eb15 = $("input[name=eb15]").val();

                    var ebl0 = $("textarea[name=ebl0]").val().replace(/[\r\n]/g,"");

                    var completed = "1";
                    if(isNullOrEmpty(side
                            && eb0
                            && eb1
                            && eb2
                            && eb3
                            && eb4
                            && eb5
                            && eb6
                            && eb7
                            && eb8
                            && eb9
                            && eb10
                            && eb11
                            && eb12
                            && eb14
                            && eb15
                            && ebl0)) {
                        completed = "-1";
                    }


                    $.ajax({
                        url:"/wechat/workorder/examBasicFoPost",
                        type:"post",
                        data:{
                            examBasicId: examBasicId,
                            workorderId: workorderId,
                            side:side,
                            eb0:eb0,
                            eb1:eb1,
                            eb2:eb2,
                            eb3:eb3,
                            eb4:eb4,
                            eb5:eb5,
                            eb6:eb6,
                            eb7:eb7,
                            eb8:eb8,
                            eb9:eb9,
                            eb10:eb10,
                            eb11:eb11,
                            eb12:eb12,
                            eb13:eb13,
                            eb14:eb14,
                            eb15:eb15,
                            ebl0:ebl0,

                            completed:completed,
                        },
                        dataType:"JSON",
                        beforeSend:function(){
                            $("#loadingToast").show();
                        },
                        complete:function(){
                            $('#loadingToast').hide();
                        },
                        success:function(data){
                            if(data.code == 200) {
//                                alert(data.alert);
                                alert("保存成功");
                                window.location.href = "/wechat/workorder/index/id/{$workorderId}";
                            }
                        },
                    })

                }
            }
        })
        $(".item select").change(function() {
            var value = $(this).find("option:selected").text();
            $(this).prev().val(value);
        });
    })

</script>

<div class="container" id="container">
    <div class="hint-info">
        <span class="update_time">{$formDict.update_time}：{$examBasic.update_time}</span>
        <span class="employee_name">{$formDict.update_name}：{$employeeName}</span>
    </div>
    <div class="edit-info">
        <div class="edit-content" >
            <input type="text" style="display: none;" name="workorderId" value="{$workorderId}">
            <input type="text" style="display: none;" name="examBasicId" value="{$examBasicId}">
        </div>
        <div class="item" style="border-bottom:0px">
            <span>位置：</span>
            <input id="side" type="text" value="{$examBasic.side}" readonly placeholder="请选择">
            <select name="side">
                <option value="{$examBasic.side}">请选择</option>
                {:getFormDictSelectOption($examBasic['side'],'side','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item" style="border-bottom:0px">
            <span>脚趾：</span>
            <input id="eb0" type="text" value="{$examBasic.eb0}" readonly placeholder="请选择">
            <select name="eb0">
                <option value="{$examBasic.eb0}">请选择</option>
                {:getFormDictSelectOption($examBasic['eb0'],'toe','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item"><span></span><input name="eb1" type="text" value="{$examBasic.eb1}" placeholder="请填写脚趾相关备注"></div>

        <div class="item" style="border-bottom:0px">
            <span>前足：</span>
            <input id="eb2" type="text" value="{$examBasic.eb2}" readonly placeholder="请选择">
            <select name="eb2">
                <option value="{$examBasic.eb2}">请选择</option>
                {:getFormDictSelectOption($examBasic['eb2'],'forefoot','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item" style="border-bottom:0px">
            <span></span>
            <input id="eb3" type="text" value="{$examBasic.eb3}" readonly placeholder="请选择">
            <select name="eb3">
                <option value="{$examBasic.eb3}">请选择</option>
                {:getFormDictSelectOption($examBasic['eb3'],'complforefoot','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item"><span></span><input name="eb4" type="text" value="{$examBasic.eb4}" placeholder="请填写前足相关备注"></div>

        <div class="item" style="border-bottom:0px">
            <span>中足(足弓)：</span>
            <input id="eb5" type="text" value="{$examBasic.eb5}" readonly placeholder="请选择">
            <select name="eb5">
                <option value="{$examBasic.eb5}">请选择</option>
                {:getFormDictSelectOption($examBasic['eb5'],'footarch','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item"><span></span><input name="eb6" type="text" value="{$examBasic.eb6}" placeholder="请填写中足(足弓)相关备注"></div>

        <div class="item" style="border-bottom:0px">
            <span>后足(跟骨)：</span>
            <input id="eb7" type="text" value="{$examBasic.eb7}" readonly placeholder="请选择">
            <select name="eb7">
                <option value="{$examBasic.eb7}">请选择</option>
                {:getFormDictSelectOption($examBasic['eb7'],'complheel','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item" style="border-bottom:0px">
            <span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp负重位：</span>
            <input id="eb8" type="text" value="{$examBasic.eb8}" readonly placeholder="请选择">
            <select name="eb8">
                <option value="{$examBasic.eb8}">请选择</option>
                {:getFormDictSelectOption($examBasic['eb8'],'heel','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item heelaangle" style="border-bottom:0px"><span></span><input name="eb9" type="text" value="{$examBasic.eb9}" placeholder="请填写负重位内外翻度数"></div>
        <div class="item" style="border-bottom:0px">
            <span>&nbsp&nbsp非负重位：</span>
            <input id="eb10" type="text" value="{$examBasic.eb10}" readonly placeholder="请选择">
            <select name="eb10">
                <option value="{$examBasic.eb10}">请选择</option>
                {:getFormDictSelectOption($examBasic['eb10'],'heel','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item heelbangle" style="border-bottom:0px"><span></span><input name="eb11" type="text" value="{$examBasic.eb11}" placeholder="请填写非负重位内外翻度数"></div>
        <div class="item"><span>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp备注:</span><input name="eb12" type="text" value="{$examBasic.eb12}" placeholder="请填写足跟(跟骨)相关备注"></div>
        <div class="item" style="border-bottom:0px"><span>鞋跟有效高度：</span><input name="eb13" type="text" value="{$examBasic.eb13}" placeholder="请输入数据(mm)"></div>
        <div class="item" style="border-bottom:0px">
            <span>平时所穿鞋号:</span>
            <input id="eb14" type="text" value="{$examBasic.eb14}" readonly placeholder="请选择">
            <select name="eb14">
                <option value="{$examBasic.eb14}">请选择</option>
                {:getFormDictSelectOption($examBasic['eb14'],'shoe_type','exam_basic',0)}
            </select>
            <img class="icon-right" src="/Template/images/icon-right.png" alt="">
        </div>
        <div class="item" style="border-bottom:0px"><span></span><input name="eb15" type="text" value="{$examBasic.eb15}" placeholder="请输入鞋号"></div>
        <div class="item">
            <span>功能障碍描述及其他备注：</span>
            <textarea class="t-area" name="ebl0" maxlength="120" placeholder="请填写">{$examBasic.ebl0}</textarea>
        </div>
    </div>
    <div class="operation-btn">
        <div class="cancle-btn" v-on:click="cancel">取消</div>
        <if condition="$workorder['status'] lt '2' && $workorder['creator_id'] eq $customerId">
           <div class="save-btn" v-on:click="save">保存</div>
            <!--<elseif condition="$workorder['status'] lt '3' && $job[0] eq 100"/>-->
            <!--<div class="save-btn" v-on:click="save">保存</div>-->
        </if>
        <!--if condition="$workorder['status'] eq '2' && $workorder['examinator_id'] eq $customerId">
            <div class="save-btn" v-on:click="save">保存</div>
        </if-->

    </div>

</div>
<include file="./Template/footer.html" />